import axios from '@/request/http';
import base from "../base";
// import QS from 'qs';

const user = {

    // 常用 CRUD
    // 获取所有数据
    getAll(){
        return axios.get(`${base.sq}/user`)
    },
    userAdd(user){
        return axios.post(`${base.sq}/user`,{
            ...user
        })
    },
    userPatch(id , user){
        return axios.patch(`${base.sq}/user/${id}`,{
            ...user
        })
    },
    userDelete(id){
        return axios.delete(`${base.sq}/user/${id}`);
    },


    getUserId(id){
        return axios.get(`${base.sq}/user/${id}`)
    },
    // userLogin(phone,passWord){
    //     return axios.get(`${base.sq}/user`,{
    //         params : {
    //             phone : phone,
    //             passWord : passWord
    //         }
    //     })
    // },
}

export default user;
